//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.baidu.trace;

import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import com.baidu.trace.IService.Stub;
import java.io.PrintWriter;
import java.io.StringWriter;

final class ap implements ServiceConnection {
    ap(LBSTraceClient var1) {
        this.a = var1;
        super();
    }

    public final void onServiceDisconnected(ComponentName var1) {
        LBSTraceClient.a(this.a, (IService)null);
    }

    public final void onServiceConnected(ComponentName var1, IBinder var2) {
        LBSTraceClient.a(this.a, Stub.asInterface(var2));
        byte var10 = 0;
        String var11 = "成功";
        boolean var7 = false;

        label70: {
            try {
                var7 = true;
                LBSTraceClient.b(this.a).registerListener(LBSTraceClient.a(this.a));
                var7 = false;
                break label70;
            } catch (Exception var8) {
                StringWriter var4 = new StringWriter();
                var8.printStackTrace(new PrintWriter(var4));
                a.a("BaiduTraceSDK", "register client listener failed, Exception : " + var4.toString());
                var10 = 1;
                var11 = "失败";
                var7 = false;
            } finally {
                if(var7) {
                    if(null != LBSTraceClient.c(this.a)) {
                        LBSTraceClient.c(this.a).onBindServiceCallback(var10, var11);
                    }

                }
            }

            if(null != LBSTraceClient.c(this.a)) {
                LBSTraceClient.c(this.a).onBindServiceCallback(1, var11);
                return;
            }

            return;
        }

        if(null != LBSTraceClient.c(this.a)) {
            LBSTraceClient.c(this.a).onBindServiceCallback(0, var11);
        }
    }
}
